<%@ page contentType="text/html;charset=UTF-8" language="java"  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<%@ taglib prefix="ssm" uri="http://ssm.elangzhi.com/jsp/tag/functions" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%--
Created by GaoXiang
Date: 2017-03-28 09:07:57 星期二
Version: 1.0
小区列表
--%>

<!DOCTYPE html>
<!--[if IE 8]> <html lang="zh" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="zh" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="zh">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8"/>
    <title>停车场管理 - 后台服务中心</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1" name="viewport"/>
    <meta content="停车场管理列表" name="description"/>
    <meta content="GaoXiang" name="author"/>
</head>
<!-- END HEAD -->
<body class="page-content-white  fade-in-up">

<!-- BEGIN CONTAINER -->
<div class="page-container">
    <!-- BEGIN PAGE TABLE-->
    <div class="portlet light">
        <div class="portlet-body table-responsive">
            <div class="table-scrollable">
                <table
                        data-visible-pages="10" class="table table-bordered table-hover" id="table">
                    <thead>
                    <tr>
                        <th>名称</th>
                        <th>省</th>
                        <th>市</th>
                        <th>区</th>
                        <th>地址</th>
                        <th>联系人</th>
                        <th>联系电话</th>
                        <th>开放时间起</th>
                        <th>开放时间止</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach var="item" items="${data}" varStatus="status">
                        <tr>
                            <td>${item.name}</td>
                            <td>${item.province}</td>
                            <td>${item.city}</td>
                            <td>${item.area}</td>
                            <td>${item.address}</td>
                            <td>${item.contacts}</td>
                            <td>${item.conPhone}</td>
                            <td>${ssm:dateToStringHourTime(item.openStarttime)}</td>
                            <td>${ssm:dateToStringHourTime(item.openStopstime)}</td>
                            <td>
                                <div class="btn-group btn-group-xs btn-group-solid">
                                        <button  onclick="ret('${item.id}','${item.name}')"  class="btn btn-success"> 选择 </button>
                                </div>
                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <!-- END PAGE TABLE-->
</div>
<!-- END CONTAINER -->

<!-- BEGIN PAGE JAVASCRIPT-->
<script>

    function ret(id,name) {
        $("#parkingId").val(id);
        $("#parkingName").val(name);
        zone(id);
        layer.close(layer_resModule);
    }
    function zone(id) {
        tools.post("/parkinglot/zone",{"id":id},function(data){
            if(data!=null){
                var zone = document.getElementById ("zone");
                if(zone==null||zone==undefined){
                    return;
                }
                var zoneId;
                for(var i=0;i<data.length;i++) {
                    var opt = document.createElement ("option");
                    opt.value = data[i].id;
                    opt.innerText = data[i].name;
                    zone.appendChild (opt);
                    zoneId=data[0].id
                }
               var zoneId = $("#zone").val();
                if(zoneId!= null && zoneId!=null){
                    document.getElementById("div-image").style.display="block";
                    $.post("/parkinglot/findZoneImg",{"id":zoneId},function(data){
                        $("#tu").attr('src',data.url);
                    });
                }

            }
        });
    }
</script>
<!-- END PAGE JAVASCRIPT-->
</body>
</html>
